//
// Created by Jisam on 11/10/2024 19:53.
// Solution of  a
#include <bits/stdc++.h>

#define  int long long
#define  endl "\n"
#define  all(x) (x).begin(),(x).end()
#define  pb push_back
using namespace std;


signed main() {
    cin.tie(nullptr)->sync_with_stdio(false);
    int t = 1;
    cin >> t;
    while (t--) {
        int n, k;
        cin >> n >> k;
        unordered_map<int, int> mp;
        int ok = 1;
        for (int i = 0; i < n; i++) {
            int x;
            cin >> x;
            mp[x]++;
        }
        for (int i = 1; i <= k; i++) {
            if (mp[i] == 0 || mp.find(i) == mp.end() ) {
                ok = 0;
                break;
            }
        }
        if (!ok) {
            cout << "NO\n";
        } else cout << "YES\n";
    }

    return 0;
}